package cn.edu.flink.tutorial.source;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

import java.util.Arrays;
import java.util.List;

public class Collection {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        // 1.Source:从集合读取数据
        List<Integer> data = Arrays.asList(1, 22, 3);
        DataStreamSource<Integer> source = env.fromCollection(data);

        // 2.打印
        source.print();

        // 3.执行
        env.execute();
    }
}
